package com.hb.trade.api.routine.controller.project.section;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONObject;
import cn.hutool.poi.excel.ExcelReader;
import cn.hutool.poi.excel.ExcelUtil;
import com.hb.core.pojo.Attachment;
import com.hb.core.pojo.Attachments;
import com.hb.core.pojo.JSONObjectProperty;
import com.hb.core.pojo.RoleDataAuthEntity;
import com.hb.core.pojo.center.au.dto.OrgDTO;
import com.hb.core.pojo.center.au.entity.Org;
import com.hb.core.pojo.enums.NewsTypeEnum;
import com.hb.core.pojo.enums.NewsTypeTwoEnum;
import com.hb.core.pojo.enums.SignupStatusEnum;
import com.hb.core.pojo.parent.PageResult;
import com.hb.core.pojo.project.notice.dto.NoticeBidSectionDTO;
import com.hb.core.pojo.project.proj.dto.BidProjectDTO;
import com.hb.core.pojo.project.proj.entity.AbstractProject;
import com.hb.core.pojo.project.section.dto.*;
import com.hb.core.pojo.project.section.entity.BidDownRecord;
import com.hb.core.pojo.project.section.entity.BidSection;
import com.hb.core.pojo.project.section.entity.BidSectionTender;
import com.hb.core.pojo.project.section.entity.SupplyBidSignup;
import com.hb.trade.api.routine.service.BidSectionService;
import com.hb.trade.api.routine.sms.annotation.SmsSend;
import com.hb.trade.api.routine.util.*;
import com.hb.trade.client.center.NewsCenterClient;
import com.hb.trade.client.center.OrgClient;
import com.hb.trade.client.center.UserClient;
import com.hb.trade.client.project.BidFileInfoClient;
import com.hb.trade.client.project.ProjectClient;
import com.hb.trade.client.project.SectionClient;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.fzzn.core.auth.shiro.util.ShiroUtil;
import org.fzzn.core.file.service.DownloadService;
import org.fzzn.core.model.constant.CommonConstant;
import org.fzzn.core.model.enums.LogicEnum;
import org.fzzn.core.model.enums.MsgEnum;
import org.fzzn.core.model.msg.Message;
import org.fzzn.core.model.msg.ResponseDto;
import org.fzzn.core.model.user.login.LoginUser;
import org.fzzn.core.service.ZipFileService;
import org.fzzn.core.third.sms.service.SmsService;
import org.fzzn.core.util.MsgUtil;
import org.fzzn.core.util.ResultUtil;
import org.fzzn.core.web.anno.Version;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.IOException;
import java.time.LocalDateTime;
import java.util.List;
import java.util.stream.Collectors;

/**
 * describe:
 * 标段相关
 *
 * @author zhongdl
 * @date 2021/12/03
 */
@Slf4j
@Version(1.0)
@Api(tags = {"标段相关"})
@RequestMapping("/{version}")
@RestController
public class ApiSectionController {

    protected final ProjectClient projectClient;
    protected final SectionClient sectionClient;
    protected final BidSectionService bidSectionService;
    protected final BidFileInfoClient bidFileInfoClient;
    protected final DownloadService downloadService;
    protected final OrgClient orgClient;
    protected final NewsCenterClient newsCenterClient;
    protected final UserClient userClient;
    protected final SmsService smsService;


    public ApiSectionController(ProjectClient projectClient,
                                SectionClient sectionClient,
                                BidSectionService bidSectionService,
                                BidFileInfoClient bidFileInfoClient,
                                DownloadService downloadService,
                                OrgClient orgClient,
                                NewsCenterClient newsCenterClient, UserClient userClient, SmsService smsService) {
        this.projectClient = projectClient;
        this.sectionClient = sectionClient;
        this.bidSectionService = bidSectionService;
        this.bidFileInfoClient = bidFileInfoClient;
        this.downloadService = downloadService;
        this.orgClient = orgClient;
        this.newsCenterClient = newsCenterClient;
        this.userClient = userClient;
        this.smsService = smsService;
    }

    @ApiOperation(value = "根据项目查询已经发布过公告(除控制价公告)的的标段列表", httpMethod = "POST")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "projectId", value = "项目id", dataTypeClass = Long.class),
    })
    @PostMapping("/bidSection/listReleaseNotice")
    public ResponseDto listReleaseNotice(@RequestBody BidSectionDTO bidSection) {
        if (bidSection.getProjectId() == null) {
            return ResultUtil.fail(MsgEnum.INCORRECT_PARAM);
        }
        Message<List<BidSection>> bidSectionList = sectionClient.listReleaseNotice(bidSection);
        return ResultUtil.msg(bidSectionList);
    }

    @ApiOperation(value = "", httpMethod = "POST")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "sectionId", value = "标段ID", dataTypeClass = Long.class)
    })
    @PostMapping("/bidSection/getBidSectionProjectInfo")
    public ResponseDto getBidSectionProjectInfo(@RequestBody BidSectionDTO bidSection) {
        Message<BidSectionDTO> bidSectionDTOMessage = sectionClient.getBidSectionProjectInfo(bidSection);
        return ResultUtil.msg(bidSectionDTOMessage);
    }

    @ApiOperation(value = "根据项目id和已选择的标段id查询未选择的标段", httpMethod = "POST")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "projectId", value = "项目id", dataTypeClass = Long.class),
            @ApiImplicitParam(name = "sectionList", value = "已选择的标段id", dataTypeClass = List.class)
    })
    @PostMapping("/bidSection/findNotChoiceBidSectionList")
    public ResponseDto findNotChoiceBidSectionList(@RequestBody List<String> sectionList, @RequestParam(value = "projectId") Long projectId) {
        Message<List<BidSection>> notChoiceBidSectionList = sectionClient.findNotChoiceBidSectionList(sectionList, projectId);
        if (notChoiceBidSectionList.isSuccess()) {
            return ResultUtil.msg(true, notChoiceBidSectionList.getData());
        }
        return ResultUtil.fail(notChoiceBidSectionList.getMessage());
    }


    @ApiOperation(value = "设置指定标段的监标人", httpMethod = "POST")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "标段ID", dataTypeClass = Long.class),
            @ApiImplicitParam(name = "monitorName", value = "监标人名称(为空时为取消监标人)", dataTypeClass = String.class)
    })
    @PostMapping("/bidSection/update/monitorName")
    public ResponseDto updateMonitorName(@RequestBody BidSectionDTO bidSection) {
        Message<Boolean> message = sectionClient.updateMonitorName(bidSection);
        return ResultUtil.msg(message);
    }

    /**
     * 根据项目id 查询标段
     *
     * @param bidSectionDTO
     * @return
     */
    @ApiOperation(value = "查询归档标段列表", httpMethod = "POST")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "标段ID", dataTypeClass = Long.class),
            @ApiImplicitParam(name = "project", value = "项目id", dataTypeClass = Long.class)
    })
    @PostMapping("/bidSection/listByProjectId")
    public ResponseDto getSectionByProjectId(@RequestBody BidSectionDTO bidSectionDTO) {
        Message<PageResult<BidSectionDTO>> message = sectionClient.getSectionByProjectId(bidSectionDTO);
        return ResultUtil.msg(message);
    }

    @ApiOperation(value = "查询标段名称和标段编号", httpMethod = "POST")
    @ApiImplicitParam(name = "sectionId", value = "标段Id", dataTypeClass = Long.class)
    @PostMapping("/bidSection/info")
    public ResponseDto info(@RequestBody BidSectionDTO bidSection) {
        Message message = sectionClient.info(bidSection);
        return ResultUtil.msg(message);
    }

    @ApiOperation(value = "开标", httpMethod = "POST")
    @ApiImplicitParam(name = "sectionId", value = "标段Id", dataTypeClass = Long.class)
    @PostMapping("/bidSection/open")
    public ResponseDto open(@RequestBody BidSectionDTO bidSection) {
        return ResultUtil.msg(sectionClient.open(bidSection.getSectionId()));
    }

    @ApiOperation(value = "根据标段Id查询所有标段信息", httpMethod = "POST")
    @ApiImplicitParam(name = "sectionId", value = "方案包信息id", dataTypeClass = Long.class)
    @PostMapping("/bidSection/findBidSectionsBySectionId")
    public ResponseDto findBidSectionsBySectionId(@RequestBody BidSectionDTO bidSection) {
        return ResultUtil.msg(sectionClient.findBidSectionsBySectionId(bidSection.getSectionId()));
    }

    @ApiOperation(value = "更改标段状态", notes = "用于工作流接口触发审核通过事件, 将标段状态由'项目信息已保存'改为'项目信息已生效'", httpMethod = "POST")
    @PostMapping("/bidSection/launchSection")
    public ResponseDto launchSection(@RequestBody BidSectionDTO bidSection) {
        return ResultUtil.msg(sectionClient.launchSection(bidSection));
    }

    @ApiOperation(value = "报价信息供应商列表", httpMethod = "POST")
    @PostMapping("/bidSectionOffer/tenders")
    public ResponseDto tenders(@RequestBody SectionOfferSearchDTO searchVO) {
        return ResultUtil.msg(sectionClient.tenders(searchVO));
    }

    @ApiOperation(value = "供应商报价详情", httpMethod = "POST")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "sectionId", value = "方案包信息id", dataTypeClass = Long.class)
    })
    @PostMapping("/bidSectionOffer/detail")
    public ResponseDto detail(@RequestBody SectionOfferSearchDTO sectionOfferSearch) {
        return ResultUtil.msg(sectionClient.detail(sectionOfferSearch));
    }

    @ApiOperation(value = "供应商报价其他信息", httpMethod = "POST")
    @PostMapping("/bidSectionOffer/offerExtInfo")
    public ResponseDto offerExtInfo(@RequestBody SectionOfferSearchDTO searchVO) {
        return ResultUtil.msg(sectionClient.offerExtInfo(searchVO));
    }

    @ApiOperation(value = "新增供应商报价", httpMethod = "POST")
    @PostMapping("/bidSectionOffer/saveOffer")
    public ResponseDto saveOffer(@RequestBody BidSectionOfferDTO sectionOfferDto) {
        LoginUser<Long> loginUser = ShiroUtil.getUser();
        if (null == loginUser) {
            return ResultUtil.fail(MsgEnum.LOGIN_EXPIRE);
        }
        sectionOfferDto.setOfferId(loginUser.getId());
        ShiroUtil.fillOwner(sectionOfferDto);
        return ResultUtil.msg(sectionClient.saveOffer(sectionOfferDto));
    }

    @ApiOperation(value = "项目基本信息", httpMethod = "POST")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "sectionId", value = "标段ID", required = true, dataTypeClass = String.class)
    })
    @PostMapping("/bidSectionOffer/projectBaseInfo")
    public ResponseDto projectBaseInfo(@RequestBody BidSectionDTO bidSection) {
        return ResultUtil.msg(sectionClient.projectBaseInfo(bidSection.getSectionId()));
    }

    @ApiOperation(value = "查询投标人报名列表信息", httpMethod = "POST")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "projectCode", value = "项目编号", dataTypeClass = String.class),
            @ApiImplicitParam(name = "projectName", value = "项目名称", dataTypeClass = String.class),
            @ApiImplicitParam(name = "participateFlag", value = "是否仅显示可参与的", dataTypeClass = Integer.class),
            @ApiImplicitParam(name = "sectionName", value = "标段名称", dataTypeClass = String.class)
    })
    @PostMapping("/supplyBidSignup/findSupplyBidSignupInfoList")
    public ResponseDto findSupplyBidSignupInfoList(@RequestBody SupplyBidSignupDTO supplyBidSignup) {
        LoginUser<Long> loginUser = ShiroUtil.getUser();
        if (null == loginUser) {
            return ResultUtil.fail(MsgEnum.LOGIN_EXPIRE);
        }
        ShiroUtil.fillOwner(supplyBidSignup);
        //投标人id
        supplyBidSignup.setBidderId(ShiroUtil.getUserId());
//        supplyBidSignup.set(loginUser.getId());
        return ResultUtil.msg(sectionClient.findSupplyBidSignupInfoList(supplyBidSignup));
    }

    @ApiOperation(value = "根据标段id查询投标人报名信息", httpMethod = "POST")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "sectionId", value = "标段id", dataTypeClass = Long.class),
    })
    @PostMapping("/supplyBidSignup/findSupplyBidSignupInfoBySectionId")
    public ResponseDto findSupplyBidSignupInfoBySectionId(@RequestBody BidSectionDTO bidSection) {
        LoginUser<Long> loginUser = ShiroUtil.getUser();
        if (null == loginUser) {
            return ResultUtil.fail(MsgEnum.LOGIN_EXPIRE);
        }
        return ResultUtil.msg(sectionClient.findSupplyBidSignupInfoBySectionId(bidSection.getSectionId(), loginUser.getId()));
    }

    @ApiOperation(value = "保存报名标段信息", httpMethod = "POST")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "SupplyBidSignupDTO", value = "投标人信息", dataTypeClass = SupplyBidSignupDTO.class),
    })
    @SmsSend(type = 5)
    @PostMapping("/supplyBidSignup/saveSupplyBidSignupInfo")
    public ResponseDto saveSupplyBidSignupInfo(@RequestBody SupplyBidSignupDTO supplyBidSignup, HttpServletRequest httpRequest) {
        //校验标段报名时间
        BidSectionDTO bidSectionDTO = new BidSectionDTO();
        supplyBidSignup.to(bidSectionDTO);
        Message<BidSection> bidSectionMessage = sectionClient.info(bidSectionDTO);
        if (bidSectionMessage.isFail() || bidSectionMessage.getData() == null) {
            return ResultUtil.fail("标段信息不存在,请刷新列表");
        }
        BidSection bidSection = bidSectionMessage.getData();
        LocalDateTime now = LocalDateTime.now();
        if (now.isBefore(bidSection.getSignStartTime()) || now.isAfter(bidSection.getSignEndTime())) {
            return ResultUtil.fail("当前时间不在报名时间范围内");
        }
        LoginUser<Long> loginUser = ShiroUtil.getUser();
        if (null == loginUser) {
            return ResultUtil.fail(MsgEnum.LOGIN_EXPIRE);
        }
        Org org = ShiroUtil.getExtInfo(Org.class);
        supplyBidSignup.buildBaseData(1);
        //投标人id
        supplyBidSignup.setBidderId(ShiroUtil.getUserId());
        supplyBidSignup.setOrgName(org.getOrgName());
        //设置报名状态为4 报名中
        supplyBidSignup.setSignupStatus(SignupStatusEnum.REG_PROGRESS.getCode());
        supplyBidSignup.setSignUpTime(LocalDateTime.now());
        ShiroUtil.fillOwner(supplyBidSignup);
        // 保存报名信息
        Message message = sectionClient.saveSupplyBidSignupInfo(supplyBidSignup, CommonUtil.getClientIpAddress(httpRequest));
        if (message.isSuccess()) {
            AbstractProject project = new AbstractProject();
            project.setId(supplyBidSignup.getProjectId());
            Message<AbstractProject> abstractProjectMessage = projectClient.projectDetail(project);
            // 将报名信息保存至供应商库
            orgClient.tenderSaveSupply(abstractProjectMessage.getData().getOrgId(), ShiroUtil.getOrgId());
        }
        JSONObjectProperty jsonEntity = new JSONObjectProperty();
        jsonEntity.putOpt("activeName","AuditList");
        //给招标人发送审核消息
        SendNewsUtil.sendTendereeNews(
                supplyBidSignup.getSectionId(),
                NewsTypeEnum.FILING_REVIEW,
                NewsTypeTwoEnum.TENDEREEFILING_REVIEW,
                null,
                "/projectconsole",
                jsonEntity
        );
        return ResultUtil.msg(message);
    }

    @ApiOperation(value = "保存投标确认函", httpMethod = "POST")
    @PostMapping("/supplyBidSignup/saveConfirmSupplyBidSignupInfo")
    public ResponseDto saveConfirmSupplyBidSignupInfo(@RequestBody SupplyBidSignupDTO supplyBidSignup) {
        LoginUser<Long> loginUser = ShiroUtil.getUser();
        if (null == loginUser) {
            return ResultUtil.fail(MsgEnum.LOGIN_EXPIRE);
        }
//        supplyBidSignup.setSupplyId(loginUser.getId());
        ShiroUtil.fillOwner(supplyBidSignup);
        return ResultUtil.msg(sectionClient.saveConfirmSupplyBidSignupInfo(supplyBidSignup));
    }

    @ApiOperation(value = "根据标段id查询投标确认函详情", httpMethod = "POST")
    @ApiImplicitParam(name = "sectionId", value = "标段id", dataTypeClass = Long.class)
    @PostMapping("/supplyBidSignup/findConfirmSupplyBidSignupDetails")
    public ResponseDto findConfirmSupplyBidSignupDetails(@RequestBody BidSectionDTO bidSection) {
        LoginUser<Long> loginUser = ShiroUtil.getUser();
        if (null == loginUser) {
            return ResultUtil.fail(MsgEnum.LOGIN_EXPIRE);
        }
        return ResultUtil.msg(sectionClient.findConfirmSupplyBidSignupDetails(bidSection.getSectionId(), loginUser.getId()));
    }

    @ApiOperation(value = "查询我的项目信息", httpMethod = "POST")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "projectCode", value = "项目编号", dataTypeClass = String.class),
            @ApiImplicitParam(name = "projectName", value = "项目名称", dataTypeClass = String.class),
            @ApiImplicitParam(name = "sectionName", value = "标段名称", dataTypeClass = String.class),
            @ApiImplicitParam(name = "signupStatus", value = "报名状态", dataTypeClass = Integer.class),
    })
    @PostMapping("/supplyBidSignup/findMyProjectList")
    public ResponseDto findMyProjectList(@RequestBody SupplyBidSignupDTO supplyBidSignup) {
        LoginUser<Long> loginUser = ShiroUtil.getUser();
        if (null == loginUser) {
            return ResultUtil.fail(MsgEnum.LOGIN_EXPIRE);
        }
//        ShiroUtil.fillOwner(supplyBidSignup);
//        supplyBidSignup.setBidderId(ShiroUtil.getUserId());

        // 设置数据权限, 添加数据权限条件
        RoleDataAuthEntity authEntity = RoleDataAuthUtil.buildDataAuth();
        supplyBidSignup.setDataAuth(authEntity);

//        supplyBidSignup.setSupplyId(loginUser.getId());
        return ResultUtil.msg(sectionClient.findMyProjectList(supplyBidSignup));
    }

    @ApiOperation(value = "根据标段id查询当前标段下的报名数量", httpMethod = "POST")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "projectId", value = "项目Id", dataTypeClass = Long.class),
            @ApiImplicitParam(name = "sectionId", value = "标段Id", dataTypeClass = Long.class)
    })
    @PostMapping("/supplyBidSignup/findSectionSignUpCount")
    public ResponseDto findSectionSignUpInfos(@RequestBody SupplyBidSignup supplyBidSignup) {
        return ResultUtil.msg(sectionClient.findSectionSignUpCount(supplyBidSignup));
    }

    @ApiOperation(value = "查询标段下所有报名信息", httpMethod = "POST")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "sectionId", value = "标段id", dataTypeClass = Long.class, required = true),
            @ApiImplicitParam(name = "orgName", value = "单位名称", dataTypeClass = String.class),
            @ApiImplicitParam(name = "contactName", value = "联系人", dataTypeClass = String.class),
            @ApiImplicitParam(name = "signupStatus", value = "1: 通过,3: 报名未通过 4 待确认", dataTypeClass = String.class),
    })
    @PostMapping("/supplyBidSignup/getSectionSignupList")
    public ResponseDto getSectionSignupList(@RequestBody SupplyBidSignupDTO supplyBidSignup) {
        Long sectionId = supplyBidSignup.getSectionId();
        if (sectionId == null) {
            return ResultUtil.msg(MsgEnum.INCORRECT_PARAM);
        }
        return ResultUtil.msg(sectionClient.getSectionSignupList(supplyBidSignup));
    }

    @ApiOperation(value = "查询标段下所有报名信息(带分页)", httpMethod = "POST")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "sectionId", value = "标段id", dataTypeClass = Long.class, required = true),
            @ApiImplicitParam(name = "orgName", value = "单位名称", dataTypeClass = String.class),
            @ApiImplicitParam(name = "contactName", value = "联系人", dataTypeClass = String.class),
            @ApiImplicitParam(name = "signupStatus", value = "1: 通过,3: 报名未通过 4 待确认", dataTypeClass = String.class),
    })
    @PostMapping("/supplyBidSignup/pageSectionSignup")
    public ResponseDto pageSectionSignup(@RequestBody SupplyBidSignupDTO supplyBidSignup) {
        Long sectionId = supplyBidSignup.getSectionId();
        if (sectionId == null) {
            return ResultUtil.msg(MsgEnum.INCORRECT_PARAM);
        }
        return ResultUtil.msg(sectionClient.pageSectionSignup(supplyBidSignup));
    }

    @ApiOperation(value = "根据标段id标段下的未审核具体报名信息", httpMethod = "POST")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "sectionId", value = "标段id", dataTypeClass = Long.class)
    })
    @PostMapping("/supplyBidSignup/findSectionSignUpList")
    public ResponseDto findSectionSignUpList(@RequestBody SupplyBidSignupDTO supplyBidSignup) {
        return ResultUtil.msg(sectionClient.findSectionSignUpList(supplyBidSignup));
    }

    @ApiOperation(value = "根据主键Id查询报名信息详情", httpMethod = "POST")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "主键Id", dataTypeClass = Long.class)
    })
    @PostMapping("/supplyBidSignup/getSupplySignupInfo")
    public ResponseDto getSupplySignupInfo(@RequestBody SupplyBidSignup supplyBidSignup) {
        return ResultUtil.msg(sectionClient.getSupplySignupInfo(supplyBidSignup));
    }

    @ApiOperation(value = "审核通过", httpMethod = "POST")
    @ApiImplicitParam(name = "id", value = "报名表主键Id", dataTypeClass = Long.class)
    @SmsSend(type = 12)
    @PostMapping("/supplyBidSignup/passExamine")
    public ResponseDto passExamine(@RequestBody SupplyBidSignup supplyBidSignup) {
        if (supplyBidSignup.getId() == null) {
            return ResultUtil.fail(MsgEnum.INCORRECT_PARAM);
        }
        Message<Boolean> booleanMessage = sectionClient.passExamine(supplyBidSignup);
        //给标人发送消息
        Message<SupplyBidSignupDTO> supplySignupInfo = sectionClient.getSupplySignupInfo(supplyBidSignup);
        if (supplySignupInfo.isFail() || supplySignupInfo.getData() == null) {
            return ResultUtil.msg(booleanMessage);
        }
        //投标人发消息
        SupplyBidSignupDTO supplyBidSignupDTO = supplySignupInfo.getData();
        List<Long> receiverIds = CollUtil.list(false, supplyBidSignupDTO.getBidderId());
        SendNewsUtil.sendBiddereeNews(
                supplyBidSignup.getSectionId(),
                NewsTypeEnum.FILING_REVIEW,
                NewsTypeTwoEnum.BIDDER_FILING_REVIEW,
                null,
                "已通过",
                "/bidder/signup/Result",
                receiverIds
        );
        return ResultUtil.msg(booleanMessage);
    }

    @ApiOperation(value = "审核不通过", httpMethod = "POST")
    @ApiImplicitParam(name = "id", value = "报名表主键Id", dataTypeClass = Long.class)
    @SmsSend(type = 13)
    @PostMapping("/supplyBidSignup/failExamine")
    public ResponseDto failExamine(@RequestBody SupplyBidSignup supplyBidSignup) {
        if (supplyBidSignup.getId() == null || StrUtil.isEmpty(supplyBidSignup.getReason())) {
            return ResultUtil.fail(MsgEnum.INCORRECT_PARAM);
        }
        Message<Boolean> booleanMessage = sectionClient.failExamine(supplyBidSignup);
        //给标人发送消息
        Message<SupplyBidSignupDTO> supplySignupInfo = sectionClient.getSupplySignupInfo(supplyBidSignup);
        if (supplySignupInfo.isFail() || supplySignupInfo.getData() == null) {
            return ResultUtil.msg(booleanMessage);
        }
        SupplyBidSignupDTO supplyBidSignupDTO = supplySignupInfo.getData();
        List<Long> receiverIds = CollUtil.list(false, supplyBidSignupDTO.getBidderId());
        SendNewsUtil.sendBiddereeNews(
                supplyBidSignup.getSectionId(),
                NewsTypeEnum.FILING_REVIEW,
                NewsTypeTwoEnum.BIDDER_FILING_REVIEW,
                null,
                "被驳回",
                "/bidder/signup/Result",
                receiverIds
        );
        return ResultUtil.msg(booleanMessage);
    }


    @ApiOperation(value = "投标人项目大厅列表", httpMethod = "POST")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "projectCode", value = "项目编号", dataTypeClass = String.class),
    })
    @PostMapping("/bidSection/pageProjectHall")
    public ResponseDto pageProjectHall(@RequestBody BidSectionDTO bidSection) {

//        ShiroUtil.fillOwner(bidSection);
//        bidSection.setBidderId(ShiroUtil.getUserId());
        RoleDataAuthEntity roleDataAuthEntity = RoleDataAuthUtil.buildDataAuth();
//        List<Long> orgIds = roleDataAuthEntity.getOrgIds();
//        List<Long> orgIds1 = new ArrayList<>();
//        orgIds1.add(ShiroUtil.getOrgId());
//        Collection subtractList = CollectionUtils.subtract(orgIds, orgIds1);
//
//        roleDataAuthEntity.setOrgIds((List)subtractList);

        bidSection.setDataAuth(roleDataAuthEntity);
        bidSection.setOrgId(ShiroUtil.getOrgId());

        Message<PageResult<BidSectionDTO>> myProjectList = sectionClient.pageProjectHall(bidSection);
        return ResultUtil.msg(myProjectList);
    }

    @ApiOperation(value = "投标人我的项目", httpMethod = "POST")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "projectCode", value = "项目编号", dataTypeClass = String.class),
    })
    @PostMapping("/bidSection/pageMyProject")
    public ResponseDto pageMyProject(@RequestBody BidSectionDTO bidSection) {

//        ShiroUtil.fillOwner(bidSection);
//        bidSection.setBidderId(ShiroUtil.getUserId());
        bidSection.setOrgId(ShiroUtil.getOrgId());
        // 设置数据权限, 添加数据权限条件
        RoleDataAuthEntity authEntity = RoleDataAuthUtil.buildDataAuth();
        bidSection.setDataAuth(authEntity);
        Message<PageResult<BidSectionDTO>> myProjectList = sectionClient.pageMyProject(bidSection);
        return ResultUtil.msg(myProjectList);
    }

    @ApiOperation(value = "投标人保存下载文件记录", httpMethod = "POST")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "sectionId", value = "标段id", dataTypeClass = Long.class),
    })
    @PostMapping("/bidDownRecord/saveBidDownRecord")
    public ResponseDto saveBidDownRecord(@RequestBody BidDownRecord bidDownRecord) {
        bidDownRecord.setBidderId(ShiroUtil.getUserId());
        ShiroUtil.fillOwner(bidDownRecord);
        Message<BidDownRecord> myProjectList = sectionClient.saveBidDownRecord(bidDownRecord);
        return ResultUtil.msg(myProjectList);
    }

    // *********************************************************************************
    // *                             section manage start                              *
    // *********************************************************************************

    @ApiOperation(value = "查询标段列表 传fileId 就查招标文件下的标段 传项目id就查项目下的标段", httpMethod = "POST")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "项目id", value = "projectId", dataTypeClass = Long.class),
            @ApiImplicitParam(name = "招标文件id", value = "fileId", dataTypeClass = Long.class),
            @ApiImplicitParam(name = "是否返回分页对象", value = "pageFlag", dataTypeClass = Long.class, required = true)
    })
    @PostMapping(value = "/bidSection/findBidSectionsByProjectId")
    public ResponseDto<?> findBidSectionsByProjectId(@RequestBody BidSectionDTO bidSection) {
        Message sectionsMsg = sectionClient.findBidSectionList(bidSection);

        // 添加标段状态值 start
        Integer pageFlag = bidSection.getPageFlag();
        if (pageFlag != null) {
            Object data = sectionsMsg.getData();
            switch (pageFlag) {
                // 处理分页对象
                case 1:
                    PageResult pageResult = BeanUtil.copyProperties(data, PageResult.class);
                    List<BidSectionDTO> bidSectionDTOS = bidSectionService.displaySectionStatuses(pageResult.getRecords());
                    pageResult.setRecords(bidSectionDTOS);
                    sectionsMsg.setData(pageResult);
                    break;
                // 处理列表对象
                case 2:
                    List<BidSectionDTO> dtoList = bidSectionService.displaySectionStatuses(Convert.toList(data));
                    sectionsMsg.setData(dtoList);
                    break;
                default:
            }
        }
        // 添加标段状态值 end

        return ResultUtil.msg(sectionsMsg);
    }

    /**
     * 查询指定公告下关联的标段信息
     *
     * @param noticeBidSection noticeId 公告ID
     * @return
     */
    @ApiOperation(value = "查询指定公告下关联的标段信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "noticeId", value = "公告ID", dataTypeClass = Long.class)
    })
    @PostMapping("/bidSection/findBidSectionsByNoticeId")
    public ResponseDto findBidSectionsByNoticeId(@RequestBody NoticeBidSectionDTO noticeBidSection) {
        Long noticeId = noticeBidSection.getNoticeId();
        if (noticeId == null) {
            return ResultUtil.msg(MsgEnum.INCORRECT_PARAM);
        }
        Message<List<BidSectionDTO>> sectionsMsg = sectionClient.findBidSectionsByNoticeId(noticeId);
        return ResultUtil.msg(sectionsMsg);
    }

    /**
     * 查询首次公告未发布过的标段信息
     *
     * @param sectionDTO
     * @return {@link ResponseDto}
     * @update zhaojk
     */
    @ApiOperation(value = "查询首次公告未发布过的标段信息", notes = "查询首次公告未发布过的标段信息", httpMethod = "POST")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "projectId", value = "项目id", dataTypeClass = String.class),
    })
    @PostMapping("/bidSection/noFirstNotice/sections")
    public ResponseDto noFirstSections(@RequestBody BidSectionDTO sectionDTO) {
        Long projectId = sectionDTO.getProjectId();
        if (projectId == null) {
            return ResultUtil.msg(MsgEnum.INCORRECT_PARAM);
        }

        // 查询首次公告未发布过的标段信息
        Message<List<BidSection>> message = sectionClient.noFirstNoticeSections(sectionDTO);
        return ResultUtil.msg(message);
    }

    /**
     * 查询没有保存过招标文件的标段信息
     *
     * @param sectionDTO
     * @return {@link ResponseDto}
     * @update zhaojk
     */
    @ApiOperation(value = "查询没有保存过招标文件的标段信息", notes = "查询没有保存过招标文件的标段信息", httpMethod = "POST")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "projectId", value = "项目id", dataTypeClass = String.class),
    })
    @PostMapping("/bidSection/noBidFile/sections")
    public ResponseDto noBidFileSections(@RequestBody BidSectionDTO sectionDTO) {
        Long projectId = sectionDTO.getProjectId();
        if (projectId == null) {
            return ResultUtil.msg(MsgEnum.INCORRECT_PARAM);
        }
        // 查询首次公告未发布过的标段信息
        Message<List<BidSection>> message = sectionClient.noBidFileSections(sectionDTO);
        return ResultUtil.msg(message);
    }


    @ApiOperation(value = "项目新建导入标段列表", notes = "项目新建导入标段列表", httpMethod = "POST")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "file", value = "文件对象", dataTypeClass = MultipartFile.class),
    })
    @PostMapping("/bidSection/importExcel")
    public ResponseDto importExcel(@RequestParam("file") MultipartFile file) throws IOException {
        ExcelReader reader = ExcelUtil.getReader(file.getInputStream());
        reader.addHeaderAlias("  * 标段（包）名称", "sectionName");
        reader.addHeaderAlias("* 合同估算价（万元）", "estimatedContractPrice");
        reader.addHeaderAlias("标段（包）内容", "sectionContent");
        reader.addHeaderAlias("* 是否允许联合体投标", "consortiumBiddingFlagName");
        reader.addHeaderAlias("* 系统使用费（元）", "systemUseFee");

        List<BidSectionDTO> read = reader.readAll(BidSectionDTO.class);
        if (CollUtil.isEmpty(read)) {
            return ResultUtil.msg(true, read);
        }
        //过滤空值
        read = read.stream().filter(bidSection -> StrUtil.isNotEmpty(bidSection.getSectionName())).collect(Collectors.toList());

        int size = read.size();
        for (int i = 0; i < size; i++) {
            String msg = "第" + (i + 2) + "行";
            BidSectionDTO bidSection = read.get(i);
            if (StrUtil.isEmpty(bidSection.getSectionName())) {
                return ResultUtil.fail(msg + "标段（包）名称必填");
            }

            if (bidSection.getEstimatedContractPrice() == null) {
                return ResultUtil.fail(msg + "合同估算价（万元）必填");
            }
            if (StrUtil.isEmpty(bidSection.getConsortiumBiddingFlagName())) {
                return ResultUtil.fail(msg + "是否允许联合体投标必填");
            }
            if (bidSection.getSystemUseFee() == null) {
                return ResultUtil.fail(msg + "系统使用费（元）必填");
            }
            //设置是否联合体投标
            bidSection.setConsortiumBiddingFlag(LogicEnum.YES.getShowName().equals(bidSection.getConsortiumBiddingFlagName().trim()) ? LogicEnum.YES.getCode() : LogicEnum.NO.getCode());

        }

        return ResultUtil.msg(true, read);
    }

    @ApiOperation(value = "关联招标文件", notes = "关联招标文件", httpMethod = "POST")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "文件对象", dataTypeClass = MultipartFile.class),
    })
    @PostMapping("/bidSection/relateBidFile")
    public ResponseDto relateBidFile(@RequestBody BidSectionDTO bidSection) {
        if (bidSection.getFileId() == null || bidSection.getId() == null) {
            return ResultUtil.fail(MsgEnum.INCORRECT_PARAM);
        }
        Message<Boolean> booleanMessage = sectionClient.relateBidFile(bidSection);

        return ResultUtil.msg(booleanMessage);
    }

    /**
     * 导出投标人报名列表信息
     *
     * @param supplyBidSignup
     * @return
     * @author zhaojk
     */
    @ApiOperation(value = "生成投标人报名列表信息的Excel文件", httpMethod = "POST")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "sectionId", value = "标段id", dataTypeClass = Long.class, required = true),
            @ApiImplicitParam(name = "signupStatus", value = "1: 报名成功, 其他值: 导出全部", dataTypeClass = String.class),
    })
    @PostMapping("/supplyBidSignup/generateData")
    public ResponseDto generateData(@RequestBody SupplyBidSignupDTO supplyBidSignup) {
        supplyBidSignup.setPageSize(1000);
        supplyBidSignup.setCurrentPage(1);

        // 查询投标人数据
        Message<List<JSONObject>> pageResultMessage =
                sectionClient.listSectionSignup(supplyBidSignup);

        // 若查询不到数据, 则不返回
        List<JSONObject> data = pageResultMessage.getData();
        if (CollUtil.isEmpty(data)) {
            return ResultUtil.fail("没有可导出数据");
        }

        // 查询标段信息
        BidSectionDTO bidSectionDTO = new BidSectionDTO();
        bidSectionDTO.setSectionId(supplyBidSignup.getSectionId());
        Message<BidSectionDTO> bidSection = sectionClient.getBidSection(bidSectionDTO);

        if (null == bidSection.getData()) {
            return ResultUtil.fail("未查询到标段信息");
        }

        try {
            Attachment attachment = SignUpUtil.expertSingUpExcel(data, bidSection.getData());
            return ResultUtil.msg(MsgUtil.success(attachment));
        } catch (IOException e) {
            e.printStackTrace();
        }
        return ResultUtil.msg(MsgUtil.fail("导出失败"));
    }

    @ApiOperation(value = "投诉异议查询标段信息，级联查询", httpMethod = "POST")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "orgId", value = "企业ID", dataTypeClass = Long.class)
    })
    @PostMapping("/bidSection/listMySection")
    public ResponseDto listMySection(@RequestBody BidProjectDTO bidProjectDTO) {
        Long orgId = ShiroUtil.getOrgId();
        bidProjectDTO.setOrgId(orgId);
        Message<List<AbstractProject>> listMySection = sectionClient.listMySection(bidProjectDTO);
        return ResultUtil.msg(listMySection);
    }
    //------------------------------二次报价相关功能start------------------------

    /**
     * Description: 专家轮询方法
     *
     * @param tradeSecondQuotationBidInfoDto
     * @author: fengbin
     * @date: 2022/2/22 17:39
     * @return: org.fzzn.core.model.msg.ResponseDto
     */
    @ApiOperation(value = "专家页面获取供应商二次报价列表", httpMethod = "POST")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "sectionId", value = "标段id", required = true, dataTypeClass = Long.class),
    })
    @PostMapping("/tradeSecondQuotationBidInfo/pollSecQuoBidInfo")
    public ResponseDto pollSecQuoBidInfo(@RequestBody TradeSecondQuotationBidInfoDto tradeSecondQuotationBidInfoDto) {
        Message<List<TradeSecondQuotationBidInfoDto>> tradeSecondQuotationBidInfoDto1 = sectionClient.pollSecQuoBidInfo(tradeSecondQuotationBidInfoDto);
        return ResultUtil.msg(tradeSecondQuotationBidInfoDto1);
    }

    @ApiOperation(value = "根据项目Id查询标段报价列表", httpMethod = "POST")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "projectId", value = "项目id", required = true, dataTypeClass = Long.class),
    })
    @PostMapping("/tradeSecondQuotationBidInfo/listByProjectId")
    public ResponseDto listByProjectId(@RequestBody TradeSecondQuotationBidInfoDto tradeSecondQuotationBidInfoDto){
        Message message = sectionClient.listByProjectId(tradeSecondQuotationBidInfoDto);
        return ResultUtil.msg(message);
    }

    /**
     * Description: 专家提交报价
     *
     * @param tradeSecondQuotationBidInfoDto
     * @author: fengbin
     * @date: 2022/2/22 17:39
     * @return: org.fzzn.core.model.msg.ResponseDto
     */
    @ApiOperation(value = "专家提交二次报价", httpMethod = "POST")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "sectionId", value = "标段id", required = true, dataTypeClass = Long.class),
            @ApiImplicitParam(name = "endType", value = "报价状态 1：进入下一轮 2：结束", required = true, dataTypeClass = Integer.class),
            @ApiImplicitParam(name = "offerId", value = "投标人id", required = true, dataTypeClass = Long.class),
            @ApiImplicitParam(name = "endTime", value = "报价时长", required = true, dataTypeClass = Integer.class)
    })
    @SmsSend(type = 14)
    @PostMapping("/tradeSecondQuotationBidInfo/saveSecQuoBidInfo")
    public ResponseDto saveSecQuoBidInfo(@RequestBody TradeSecondQuotationBidInfoDto tradeSecondQuotationBidInfoDto) {
        Message<Boolean> booleanMessage = sectionClient.saveSecQuoBidInfo(tradeSecondQuotationBidInfoDto);
        return ResultUtil.msg(booleanMessage);
    }

    /**
     * Description: 供应商提交报价
     *
     * @param bidSectionOffer
     * @author: fengbin
     * @date: 2022/2/21 17:23
     * @return: java.lang.Boolean
     */
    @ApiOperation(value = "供应商提交报价", httpMethod = "POST")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "offerOrder", value = "当前轮次", required = true, dataTypeClass = Integer.class),
            @ApiImplicitParam(name = "offerId", value = "投标人id", required = true, dataTypeClass = Long.class),
            @ApiImplicitParam(name = "paramValue", value = "报价", required = true, dataTypeClass = Integer.class),
    })
    @PostMapping("/bidSectionOffer/legalSubmit")
    public ResponseDto legalSubmit(@RequestBody BidSectionOfferDTO bidSectionOffer) {
        LoginUser<Long> loginUser = ShiroUtil.getUser();
        if (null == loginUser) {
            return ResultUtil.fail(MsgEnum.LOGIN_EXPIRE);
        }
        bidSectionOffer.setOfferId(loginUser.getId());
        Message<String> stringMessage = sectionClient.legalSubmit(bidSectionOffer);
        return ResultUtil.msg(stringMessage);
    }


    /**
     * Description:  获取投标人报价列表
     *
     * @param sectionId
     * @author: fengbin
     * @date: 2022/2/22 10:33
     * @return: java.util.List<com.hb.core.pojo.project.section.dto.BidSectionOfferDTO>
     */
    @ApiOperation(value = "获取投标人报价列表(以轮次倒叙排列)", httpMethod = "GET")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "sectionId", value = "标段id", required = true, dataTypeClass = Long.class),
    })
    @GetMapping("/bidSectionOffer/listOfferInfosByOffId")
    public ResponseDto listOfferInfosByOffId(@RequestParam("sectionId") Long sectionId) {
        LoginUser<Long> loginUser = ShiroUtil.getUser();
        if (null == loginUser) {
            return ResultUtil.fail(MsgEnum.LOGIN_EXPIRE);
        }
        Long offerId = loginUser.getId();
        Message<List<BidSectionOfferDTO>> listMessage = sectionClient.listOfferInfosByOffId(offerId, sectionId);
        return ResultUtil.msg(listMessage);
    }



    /**
     * Description: 金额小写转大写
     *
     * @param digit
     * @author: fengbin
     * @date: 2022/2/23 13:18
     * @return: org.fzzn.core.model.msg.Message<java.lang.String>
     */
    @ApiOperation(value = "金额小写转大写", httpMethod = "GET")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "digit", value = "小写金额", required = true, dataTypeClass = String.class),
    })
    @GetMapping("/DigitToChineseUtil/digitToChinese")
    public ResponseDto digitToChinese(@RequestParam("digit") String digit) {
        Message<String> digitValue = sectionClient.digitToChinese(digit);
        return ResultUtil.msg(digitValue);
    }


//-------------------------------二次报价相关功能end--------------------------------------


    /**
     * 根据项目id查询每个标段下的递交文件数
     *
     * @param bidSectionDTO
     * @return org.fzzn.core.model.msg.ResponseDto
     * @author tian
     * @date 2022-4-21 9:47
     */
    @ApiOperation(value = "根据项目id查询每个标段下的递交文件数", httpMethod = "GET")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "projectId", value = "招标项目id", required = true, dataTypeClass = Long.class),
    })
    @PostMapping("/bidSection/listSubmitInfoByProjectId")
    public ResponseDto listSubmitInfoByProjectId(@RequestBody BidSectionDTO bidSectionDTO) {
        Message<PageResult<BidSectionDTO>> info = sectionClient.listSubmitInfoByProjectId(bidSectionDTO);
        return ResultUtil.msg(info);
    }



    /**
     * 分批下载解密后的投标文件
     *
     * @param bidSectionTender
     * @return org.fzzn.core.model.msg.ResponseDto
     * @author tian
     * @date 2022-4-21 9:47
     */
    @ApiOperation(value = "打包下载标段下的已解密的投标文件", httpMethod = "GET")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "sectionId", value = "标段id", required = true, dataTypeClass = Long.class),
            @ApiImplicitParam(name = "id", value = "公司投标记录id", required = true, dataTypeClass = Long.class)
    })
    @RequestMapping("/bidSection/downloadTenderPdfBySectionId")
    public ResponseDto downloadTenderPdfBySectionId(@RequestBody BidSectionTenderDTO bidSectionTender) {
        if (null == bidSectionTender.getId() || null == bidSectionTender.getSectionId()) {
            return ResultUtil.fail(MsgEnum.LOGIN_EXPIRE);
        }
        Message<BidSectionTender> detailById = sectionClient.getDetailById(bidSectionTender);
        if (detailById.isSuccess() && CollUtil.isNotEmpty(detailById.getData().getTenderPdf())) {
            Attachments tenderPdf = detailById.getData().getTenderPdf();
            // 远程文件
            if (StrUtil.isNotEmpty(tenderPdf.get(0).getFileUrl())) {
                Message<OrgDTO> orgById = orgClient.getOrgById(detailById.getData().getOrgId());
                if (orgById.isSuccess()) {
                    String tenderFile = orgById.getData().getOrgName() + bidSectionTender.getSectionId() + CommonConstant.COMMA + tenderPdf.get(0).getExtName();
                    File tempFile = new File(CommonConstant.TEMP_PATH + "/" + bidSectionTender.getSectionId() + "/" + tenderFile);
                    // 创建空白文件
                    if (!tempFile.exists()) {
                        FileUtil.touch(tempFile);
                    }
                    HttpUtil.downloadFile(tenderPdf.get(0).getFileUrl(), tempFile);
                    return ResultUtil.success("下载成功");
                }

            }
        }
        return ResultUtil.fail("下载失败，未查询到待打包的投标文件");
    }


    /**
     * 打包下载标段下的已解密的投标文件
     *
     * @param bidSectionTender
     * @return org.fzzn.core.model.msg.ResponseDto
     * @author tian
     * @date 2022-4-21 9:47
     */
    @ApiOperation(value = "打包下载标段下的已解密的投标文件", httpMethod = "GET")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "sectionId", value = "标段id", required = true, dataTypeClass = Long.class),
    })
    @RequestMapping("/bidSection/downloadAllTenderPdfBySectionId")
    public void downloadAllTenderPdfBySectionId(@RequestBody BidSectionTenderDTO bidSectionTender, HttpServletResponse response) {
        File tempFile = new File(CommonConstant.TEMP_PATH + "/" + bidSectionTender.getSectionId());
        if (!tempFile.exists()) {
            return;
        }

        List<File> allFile = FileUtils.getAllFile(tempFile);

        // 构建压缩包文件, 并添加文件
        ZipFileService zipFileService = ZipFileService.getInstance();

        for (File file : allFile) {
            zipFileService.add(file.getName(), file);
        }

        // 生成下载文件
        File file = zipFileService.file(bidSectionTender.getSectionCode() + CommonConstant.COMMA + "zip");
        downloadService.download(file.getName(), file, response);

    }

    @ApiOperation(value = "邀请书专用查询标段列表", httpMethod = "GET")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "sectionName", value = "标段名称", required = false, dataTypeClass = String.class),
            @ApiImplicitParam(name = "projectId", value = "项目id", required = false, dataTypeClass = String.class),
            @ApiImplicitParam(name = "activeIdList", value = "已选中标段列表", required = false, dataTypeClass = List.class),
    })
    @PostMapping("/bidSection/inviteSectionList")
    public ResponseDto<List> inviteSectionList(@RequestBody BidSectionDTO bidSectionDTO) {
        return ResultUtil.msg(sectionClient.inviteSectionList(bidSectionDTO));
    }
}
